using System;
using System.Collections;
using System.Web.UI.WebControls;
using Sedna.Core.Controller.Configurations;
using Sedna.Core.Globalization;
using Sedna.Core.Security;
using Sedna.Core.Tiles.Contents;
using Spring.Objects.Factory;

namespace Sedna.Core.Controller
{
	public interface IConfiguration : IObjectNameAware, IContent
	{
		string Id
		{
			get;
		}

		new string ObjectName
		{
			get;
		}
	    
	    
		IAction GetAction(string name);
		IExceptionHandler GetExceptionHandler(Exception exception);

	    
	    
		bool IsVisibleForPrincipal();
		bool IsEnabledForPrincipal();

		IPrincipalWrapper PrincipalWrapper
		{
			get;
		}

		IDictionary ClientAttributes
		{
			get;
		}

		IMessageManager MessageManager
		{
			get;
		}

		IImageManager ImageManager
		{
			get;
		}

		bool CausesValidation
		{
			get;
		}

		string CausesValidationBindPath
		{
			get;
		}

		string CausesValidationUnbindPath
		{
			get;
		}
                

        /// <summary>
        /// Allows unbind when a page loads for the first time
        /// </summary>
        bool AllowFirstUnbind(string propertyName);	    

		IList ValidatorWrappers//of ValidatorWrapper
		{
			get;
		}

        string ValidationGroup
        {
            get;
        }

		string ExecutionContextPrefix
		{
			get;
		}

		/// <summary>
		/// used primarily in DataGrid to instantiate appropriate button/imagebutton/etc in a grid row
		/// normally it should be null
		/// </summary>
		Type ControlType
		{
			get;
		}

		string Label
		{
			get;
		}

		string LabelKey
		{
			get;
		}

/*
		string ImageUrl
		{
			get;
		}
*/

		string TextKey
		{
			get;
		}

		string TextKeyBindPath
		{
			get;
		}

		string TextKeyUnbindPath
		{
			get;
		}

		string TextBindPath
		{
			get;
		}

		string TextUnbindPath
		{
			get;
		}

		string ValueBindPath
		{
			get;
		}

		string ValueUnbindPath
		{
			get;
		}

		Unit Width
		{
			get;
		}

		Unit Height
		{
			get;
		}

		string CssClass
		{
			get;
		}

		IDataTranslator DataTranslator
		{
			get;
		}

		IDataTranslator DataParser
		{
			get;
		}

        IDataTranslator GetDataTranslator(string property);

        IDataTranslator GetDataParser(string property);
	    
	    
		bool Visible
		{
			get;
		}

		bool Enabled
		{
			get;
		}

		string VisibleBindPath
		{
			get;
		}

		string VisibleUnbindPath
		{
			get;
		}

		string EnabledBindPath
		{
			get;
		}

		string EnabledUnbindPath
		{
			get;
		}

        string ValidationGroupBindPath
        {
            get;
        }

        string ValidationGroupUnbindPath
        {
            get;
        }

//		string EntityPath
//		{
//			get;
//		}
//
//		string BindDirection
//		{
//			get;
//		}
//
//		IDictionary EntityPaths
//		{
//			get;
//		}

		string GetLocalizedLabel();
		string GetLocalizedLabel(string defaultValue);

		string GetLocalizedPostfixLabel(string postfix);
		string GetLocalizedPostfixLabel(string postfix, string defaultValue);

		string GetLocalizedPrefixLabel(string prefix);
		string GetLocalizedPrefixLabel(string prefix, string defaultValue);




		/// <summary>
		/// creates a new instance of a corresponding IConfiguration instance and populates it with 
		/// all necessary (depends on a particular configuration type/class) collaborators
		/// </summary>
		/// <returns></returns>
		IConfiguration CreateFromTemplate();

        bool ReadOnly
        {
            get;
        }

        string ReadOnlyBindPath
        {
            get;
        }

        string ReadOnlyUnbindPath
        {
            get;
        }

        bool DoBind { get; }

        bool DoUnbind { get; }

        string ToolTip { get;}
        string ToolTipKey { get;}
	    
        string ToolTipKeyBindPath { get;}
        string ToolTipKeyUnbindPath { get;}
        string ToolTipBindPath { get;}
        string ToolTipUnbindPath { get;}
    }
}
